
const state = {
  // 设置属性
  homeData:localStorage.homeData?JSON.parse(localStorage.homeData):{} ,//首页内容展示静态
  queryStr:[]
}

const getters = {
  // 获取属性的状态
  getHomeData: state => state.homeData,
  getQueryStr: state => state.queryStr
}

const mutations = {
  // 改变属性的状态
  setHomeData(state,data){
    localStorage.setItem('homeData', JSON.stringify(data))
    // console.log(JSON.parse(localStorage.homeData))
    state.homeData = data
  },
  setQueryStr(state,data){

    state.queryStr = data
  }

}

const actions = {

}

export default{
  state,
  getters,
  mutations,
  actions
}
